package com.lsu.chain.experiment;

/**
 * 王昭君
 *
 * @Author wang suo
 * @Date 2020/11/26 0026 21:10
 * @Version 1.0
 */
public class ZhaoJun extends AbstractChain {
    @Override
    public void handlerRequest(String[] request) {
        if (Integer.parseInt(request[2]) > getNum()) {
            setMax("昭君");
            setNum(Integer.parseInt(request[2]));
        }
        if ("12".equals(request[2])) {
            System.out.println("昭君是猪");
        } else {
            if (getNext() != null) {
                getNext().handlerRequest(request);
            } else {
                System.out.println("游戏结束,没有人是猪!");
            }
        }
    }
}
